﻿using System;

namespace Puppy.Scheduler.Tasks
{
    public class TaskEntity
    {
        public string TaskId { get; set; }

        public long InstanceId { get; set; }

        public long SubInstanceId { get; set; }

        public string TaskName { get; set; }

        public byte[] TaskContent { get; set; }

        public int Status { get; set; }

        public string Result { get; set; }

        public int FailedCount { get; set; }

        public DateTime CreateTime { get; set; }

        public DateTime LastModifiedTime { get; set; }

        public DateTime LastReportTime { get; set; }

        public override string ToString()
        {
            return "{" +
                $@"taskId='{TaskId}', instanceId='{InstanceId}', subInstanceId='{SubInstanceId}', taskName='{TaskName}', status='{Status}', result='{Result}', failedCount='{FailedCount}', createTime='{CreateTime}', lastModifiedTime='{LastModifiedTime}', lastReportTime='{LastReportTime}'" +
                "}";
        }
    }
}
